package com.yingside.collection.homework;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Test9 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一串字符");
        String str = input.next();

        //把字符串转换为char类型的数组
        char[] chars = str.toCharArray();

        Set<Character> sets = new HashSet<>();
        for (Character c:chars) {
            sets.add(c);
        }

        System.out.println("sets = " + sets);

    }
}
